<?php
/**
 * 
 *
 * @category   Cms
 * @package    Form
 * @copyright  Copyright (c) 2005-2008 vsplash techworks.ltd
 *  11/07/2008 17:24
 */
 
 require_once('Zend/Dojo/Form.php');
 
 class Cms_Form extends Zend_Dojo_Form
 {
 	protected $LANGUAGE;
	protected $CONFIG;
	
	public function ValidateDojoForm()
	{
		 $this->getView()->validateDojoForm($this->getName());
	}
	
	public function sendAjaxForm($url)
	{
		$this->getView()->sendAjaxForm($this->getName(), $url);
	}
 	
	public function sendAjaxIOForm($url)
	{
		$this->getView()->sendAjaxIOForm($this->getName(), $url);
	}
	
 	public function __construct()
	{
		$this->addElementPrefixPath('Cms_Validate', 'Cms/Validate/', 'validate');
		$this->addPrefixPath('Cms_Form_Decorator', 'Cms/Form/Decorator/', 'decorator');
		$this->addPrefixPath('Cms_Form_Element', 'Cms/Form/Element/', 'element');
		$this->addPrefixPath('Cms_Dojo_Form_Element', 'Cms/Dojo/Form/Element/', 'element');
	
		$this->LANGUAGE = Zend_Registry::get('language');
		$this->CONFIG = Zend_Registry::get('config');
		
		parent::__construct();
		
		$translate = Zend_Registry::get('Zend_Translate');
		$this->setTranslator($translate);
	}
}